<?php
class susheModel extends model{
	public $base;
	function __construct(&$base){
		parent::__construct($base);
		$this->base=$base;
		$this->table="sushe";
	}
	
	 
	
	public function getListByIds($uids,$fields=""){
		if(!empty($uids)){
			$option['where']="  id in(".implode(",",$uids).")";
			$fields && $option['fields']=$fields;
			$data=parent::select($option);
			if($data){
				$userlist=array();
				foreach($data as $k=>$v){
					$userlist[$v['id']]=$v;
				}
				return $userlist;
			}
		}
		return false;
	}
	/*根据用户获取通宿舍成员*/
	public function getcyByUser($userid){
		$sushe=M("sushe_user")->selectRow("userid=".$userid);
		if($sushe){
			return M("sushe_user")->select(array("where"=>"sushe=".$sushe['sushe']));
		}
	}
	
	 
	
	
}
?>